package com.scf.common.vo;

import lombok.Getter;

import java.util.Objects;

/**
 * 枚举类
 *
 * @author sunchuanfu
 */
@Getter
public enum Sex {
    MAN("男", 1), WOMAN("女", 2);

    private final String label;
    private final Integer value;

    Sex(String label, int value) {
        this.label = label;
        this.value = value;
    }

    /**
     * 判断值是否满足枚举中的value
     */
    public static boolean validation(Integer value) {
        for (Sex s : Sex.values()) {
            if (Objects.equals(s.getValue(), value)) {
                return true;
            }
        }
        return false;
    }

}
